home *** CD-ROM | disk | FTP | other *** search
- VERSION 4.00
- Begin VB.Form TileForm
- Caption = "Tile"
- ClientHeight = 4350
- ClientLeft = 1740
- ClientTop = 1185
- ClientWidth = 5655
- Height = 5040
- Left = 1680
- LinkTopic = "Form1"
- ScaleHeight = 290
- ScaleMode = 3 'Pixel
- ScaleWidth = 377
- Top = 555
- Width = 5775
- Begin VB.PictureBox Canvas
- AutoRedraw = -1 'True
- Height = 4335
- Left = 1320
- ScaleHeight = 285
- ScaleMode = 3 'Pixel
- ScaleWidth = 285
- TabIndex = 0
- Top = 0
- Width = 4335
- End
- Begin VB.Image Tile
- Height = 480
- Index = 2
- Left = 0
- Picture = "Tile.frx":0000
- Top = 1200
- Width = 480
- End
- Begin VB.Image Tile
- Height = 480
- Index = 1
- Left = 0
- Picture = "Tile.frx":0282
- Top = 600
- Width = 480
- End
- Begin VB.Image Tile
- Height = 420
- Index = 7
- Left = 600
- Picture = "Tile.frx":0504
- Top = 0
- Width = 420
- End
- Begin VB.Image Tile
- Height = 480
- Index = 0
- Left = 0
- Picture = "Tile.frx":0746
- Top = 0
- Width = 480
- End
- Begin VB.Image Tile
- Height = 450
- Index = 5
- Left = 0
- Picture = "Tile.frx":09C8
- Top = 3000
- Width = 450
- End
- Begin VB.Image Tile
- Height = 420
- Index = 6
- Left = 0
- Picture = "Tile.frx":0C2A
- Top = 3600
- Width = 360
- End
- Begin VB.Image Tile
- Height = 600
- Index = 13
- Left = 600
- Picture = "Tile.frx":0DFC
- Top = 3720
- Width = 600
- End
- Begin VB.Image Tile
- Height = 600
- Index = 12
- Left = 600
- Picture = "Tile.frx":119E
- Top = 3000
- Width = 600
- End
- Begin VB.Image Tile
- Height = 600
- Index = 11
- Left = 600
- Picture = "Tile.frx":1540
- Top = 2280
- Width = 600
- End
- Begin VB.Image Tile
- Height = 480
- Index = 8
- Left = 600
- Picture = "Tile.frx":18E2
- Top = 480
- Width = 480
- End
- Begin VB.Image Tile
- Height = 480
- Index = 4
- Left = 0
- Picture = "Tile.frx":1B64
- Top = 2400
- Width = 480
- End
- Begin VB.Image Tile
- Height = 480
- Index = 3
- Left = 0
- Picture = "Tile.frx":1DE6
- Top = 1800
- Width = 480
- End
- Begin VB.Image Tile
- Height = 480
- Index = 10
- Left = 600
- Picture = "Tile.frx":2068
- Top = 1680
- Width = 480
- End
- Begin VB.Image Tile
- Height = 480
- Index = 9
- Left = 600
- Picture = "Tile.frx":22EA
- Top = 1080
- Width = 480
- End
- Begin VB.Menu mnuFile
- Caption = "&File"
- Begin VB.Menu mnuFileExit
- Caption = "E&xit"
- End
- End
- Attribute VB_Name = "TileForm"
- Attribute VB_Creatable = False
- Attribute VB_Exposed = False
- Option Explicit
- Dim TileChoice As Integer
- ' ************************************************
- ' Tile the control with the Tile.
- ' ************************************************
- Sub TilePicture(pic As PictureBox, tile_image As Image)
- Dim wid As Integer
- Dim hgt As Integer
- Dim rows As Integer
- Dim cols As Integer
- Dim r As Integer
- Dim c As Integer
- Dim x As Integer
- Dim y As Integer
- pic.Cls ' Clear the picture box.
- wid = tile_image.Width
- hgt = tile_image.Height
- ' See how many rows and columns we will need.
- cols = Int(pic.ScaleWidth / wid + 1)
- rows = Int(pic.ScaleHeight / hgt + 1)
- ' Copy the tile.
- y = 0
- For r = 1 To rows
- x = 0
- For c = 1 To cols
- pic.PaintPicture tile_image.Picture, x, y
- x = x + wid
- Next c
- y = y + hgt
- Next r
- End Sub
- ' ************************************************
- ' Tile the form.
- ' ************************************************
- Private Sub Form_Resize()
- Canvas.Move Canvas.Left, 0, _
- TileForm.ScaleWidth - Canvas.Left, _
- TileForm.ScaleHeight
- TilePicture Canvas, Tile(TileChoice)
- End Sub
- Private Sub mnuFileExit_Click()
- Unload Me
- End Sub
- Private Sub Tile_Click(Index As Integer)
- TileChoice = Index
- TilePicture Canvas, Tile(Index)
- End Sub
-